package net.zoneland.knowledge.service;

import java.util.Map;
import java.util.function.Consumer;

public interface EmailService<T, K> {

    void sendEmail(Consumer<Map<String, Object>> sendFunction, T t, K k);

    void sendEmail(Consumer<Map<String, Object>> sendFunction, T t);

    /**
     * 通用邮件发送
     * @param titleTemplate 标题
     * @param contentTemplate 内容
     * @param flowType 流程类型
     * @param taskUrl 跳转地址
     * @param map 参数
     */
    void sendEmailFunction(final String titleTemplate,final String contentTemplate, final String flowType, final String taskUrl,
                           final Map<String, Object> map);

    /**
     * 指定人员发送邮件.
     * @param sendFunction  Consumer<Map<String, Object>>.
     * @param t 参数
     * @param k 工单信息参数名
     * @param role 接收人员角色
     * @param users 接收人员
     */
    void sendEmail(final Consumer<Map<String, Object>> sendFunction, final T t, final K k, final String role, final String[] users);

    void sendEmailFunctionForIssued(final String titleTemplate, final String contentTemplate, final String flowType, final String taskUrl,
                                    final Map<String, Object> map);
}
